//
//  YCTitleContentViewController.h
//  TitleContent
//
//  Created by 唐可雄 on 2019/7/14.
//  Copyright © 2019 swustyc. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "YCTitleContentConfig.h"

@class YCTitleContentViewController;

NS_ASSUME_NONNULL_BEGIN

@protocol YCTitleContentViewControllerDelegate <NSObject>

- (void)titleContentViewController:(YCTitleContentViewController *)titleContentVC didSelectAtIndex:(NSInteger)index;

@end

@protocol YCTitleContentViewControllerDataSource <NSObject>

@required
- (NSUInteger)numberOfTitlesInTitleContentViewController:(YCTitleContentViewController *)titleContentVC;
- (UIViewController *)titleContentViewController:(YCTitleContentViewController *)titleContentVC contentViewControllerForIndex:(NSInteger)index;

@optional
- (NSString *)titleContentViewController:(YCTitleContentViewController *)titleContentVC textTitleForIndex:(NSUInteger)index;
- (UIImage *)titleContentViewController:(YCTitleContentViewController *)titleContentVC imageTitleForIndex:(NSUInteger)index;
- (Class)customCellClassInTitleContentViewController:(YCTitleContentViewController *)titleContentVC;
- (UIButton *)rightButtonInTitleContentViewController:(YCTitleContentViewController *)titleContentVC;
- (void)titleContentViewController:(YCTitleContentViewController *)titleContentVC configCellAtIndex:(NSUInteger)index;

@end

/**
 Title-Content结构视图控制器
 */
@interface YCTitleContentViewController : UIViewController

/**
 配置
 */
@property (nonatomic, strong) YCTitleContentConfig *config;
/**
 数据源
 */
@property (nonatomic, weak) id<YCTitleContentViewControllerDataSource> dataSource;

/**
 代理
 */
@property (nonatomic, weak) id<YCTitleContentViewControllerDelegate> delegate;

/**
 当前选中的
 */
@property (nonatomic, assign) NSInteger selectedIndex;

/**
 显示在父视图中

 @param parentVC 父视图
 */
- (void)displayInParentViewController:(UIViewController *)parentVC;
- (void)reloadData;

@end

NS_ASSUME_NONNULL_END
